package com.thekernel.youdaoyun.service;

import com.thekernel.youdaoyun.bean.Feedback;
import com.thekernel.youdaoyun.bean.Label;
import com.thekernel.youdaoyun.bean.Note;
import com.thekernel.youdaoyun.exception.MyException;
import org.springframework.stereotype.Repository;

/**
 * @Author: thekernel
 * @Date: 2020/3/26 16:41
 * @Version: 1.0
 * @Description:
 */
@Repository
public interface LabelService {

    /**
     * 添加标签
     *
     * @param label 标签(label, user_id)
     * @return -1: Data Not Found 0: Note Already Exists 1: Success
     */
    int addLabel(Label label) throws MyException;

    /**
     * 查询所有标签
     *
     * @param userId 用户id
     * @return 该用户的所有标签
     * @throws MyException 用户未登录等
     */
    Label[] queryLabels(long userId) throws MyException;

    /**
     * 查询笔记的所有标签
     *
     * @param noteId 笔记id
     * @return 该笔记的所有标签
     * @throws MyException 用户未登录等
     */
    Label[] queryNoteLabels(int noteId) throws MyException;

    /**
     * 查询属于该标签的所有笔记
     *
     * @param labelId 标签id
     * @return 所有笔记
     * @throws MyException 用户未登录等
     */
    Note[] queryNotesByLabelId(int labelId) throws MyException;

}
